<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //使用const关键字声明的常量具有块级作用域
        if(true){
            const a = 10;
            if(true){
                const a = 20;
                console.log(a);
            }
            consle.log(a);
        }
        console.log(a);
        //使用const关键字声明的常量必须赋初始值
        //const PI=3.14;
        //PI = 100;

        const arr = [100,200];
        arr[0] = 123;
        
        arr = [1,2];
        console.log(arr);
    </script>
</body>
</html>